package com.study.pool1;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @author zhuzi
 * 2022/8/28 08:55
 */
public class Resource {
    private static int id;
    private int rid;

    public Resource() {
        synchronized (this) {
            this.rid = id++;
        }
    }

    public int getRid() {
        return rid;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.NO_CLASS_NAME_STYLE);
    }
}
